Repository navigation
Give each reference to a repeated footnote its own id - #777
Open
SwastikTripathi wants to merge 2 commits into
Open
SwastikTripathi wants to merge 2 commits into
SwastikTripathi wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a footnote is referenced more than once, every reference gets the same
id="fnref-<id>", so the page has duplicate ids. That's invalid HTML, and anything that links to or styles a single reference (the footnote's back link included) only sees whichever one the browser picks:The first reference in the document now keeps
fnref-<id>, which the back link points to, and later ones getfnref2-<id>,fnref3-<id>and so on. A normalized footnote id only contains word characters and-, so these can't collide with another footnote'sfnref-<id>.The ids are numbered in the same pass that already numbers the references (
_do_footnote_marker), not while the links are processed. That pass runs over the finished text in document order, while lists are rendered before the paragraphs around them, so counting earlier would givefnref-<id>to a reference in a list instead of the first one in the text.repeated_footnote_labels(from #727) already covers repeated references in paragraphs, list items and footnote bodies. Its expected output had the duplicate ids, so I updated it. It fails before the change and passes after. The rest of the suite is unchanged (the same 14 known failures as on master).